$(document).ready(function(){	
	$('input[type=checkbox]').click(function(){
		var blogDaskboard 			= 0;
		var blogNotificaiton		= 0;
		var blogEmail				= 0;
		var imageDaskboard			= 0;
		var imageNotification		= 0;
		var imageEmail				= 0;
		var fullhouseDaskboard		= 0;
		var fullhouseNotification	= 0;
		var fullhouseEmail			= 0;
		var offlineDaskboard		= 0;
		var offlineNotification		= 0;
		var offlineEmail			= 0;
		var cookieNotification		= '';
		//blog
		$("input[name='pbdaskboard[]']").each(function() {
			if($(this).attr('checked')) {
				blogDaskboard += parseInt($(this).val());
			}
		});	
		$("input[name='pbnotification[]']").each(function() {
			if($(this).attr('checked'))
				blogNotificaiton += parseInt($(this).val());	
		});
		$("input[name='pbemail[]']").each(function() {
			if($(this).attr('checked'))
				blogEmail += parseInt($(this).val());	
		});
		//image
		$("input[name='pidaskboard[]']").each(function() {
			if($(this).attr('checked')) {
				imageDaskboard += parseInt($(this).val());
			}
		});	
		$("input[name='pinotification[]']").each(function() {
			if($(this).attr('checked'))
				imageNotification += parseInt($(this).val());	
		});
		$("input[name='piemail[]']").each(function() {
			if($(this).attr('checked'))
				imageEmail += parseInt($(this).val());	
		});
		//full house
		$("input[name='pfdaskboard[]']").each(function() {
			if($(this).attr('checked')) {
				fullhouseDaskboard += parseInt($(this).val());
			}
		});	
		$("input[name='pfnotification[]']").each(function() {
			if($(this).attr('checked'))
				fullhouseNotification += parseInt($(this).val());	
		});
		$("input[name='pfemail[]']").each(function() {
			if($(this).attr('checked'))
				fullhouseEmail += parseInt($(this).val());	
		});
		// offline
		$("input[name='podaskboard[]']").each(function() {
			if($(this).attr('checked')) {
				offlineDaskboard += parseInt($(this).val());
			}
		});	
		$("input[name='ponotification[]']").each(function() {
			if($(this).attr('checked'))
				offlineNotification += parseInt($(this).val());	
		});
		$("input[name='poemail[]']").each(function() {
			if($(this).attr('checked'))
				offlineEmail += parseInt($(this).val());	
		});
		
		cookieNotification = blogDaskboard + "::" + blogNotificaiton + "::" + blogEmail + "::" + imageDaskboard + "::" + imageNotification + "::" + imageEmail + "::" + fullhouseDaskboard + "::" + fullhouseNotification + "::" + fullhouseEmail + "::" + offlineDaskboard + "::" + offlineNotification + "::" + offlineEmail;
		$.cookie("COOKIE_VFRIEND_SETTING_NOTIFICATION",cookieNotification);		
	});	
	
});